﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PolePosition.v3.Desktop.Selectors
{
    class Helper
    {
        public static bool SelectProject(out int? id, out string name, out Common.Enumerations.DataTypes type)
        {
            Selectors.SelectDataElements _DataElements;
            _DataElements = new Selectors.SelectDataElements(Selectors.SelectDataElements.SelectDataElementTypes.Projects);
            if (_DataElements.ShowDialog() == DialogResult.OK)
            {
                id = _DataElements.SelectedId;
                name = _DataElements.SelectedName;
                type = _DataElements.SelectedType;
                _DataElements.Dispose();
                return true;
            }
            else
            {
                id = null;
                name = string.Empty;
                type = PolePosition.v3.Common.Enumerations.DataTypes.None;
                _DataElements.Dispose();
                return false;
            }

        }
    }
}
